package me.derek.rs.service;

import me.derek.rs.model.Customer;
import org.springframework.stereotype.Service;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.Collection;

/**
 */
@Path("/")
@Service
public interface CustomerService {

    @GET
    @Path("/customers")
    @Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML})
    Collection getCustomers();

    @DELETE
    @Path("/customers")
    Response deleteCustomers();

    @GET
    @Path("/customer/{id}")
    @Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML})
    Customer getCustomer(@PathParam("id") Long id);

    @PUT
    @Path("/customer")
    Response updateCustomer(Customer customer);

    @POST
    @Path("/customer")
    Response addCustomer(Customer customer);

    @DELETE
    @Path("/customer/{id}")
    Response deleteCustomer(@PathParam("id") Long id);
}
